<template>
    <div class="Box">
        <div class="imgBox">
            <img :src="props.image_urls" @click="go"/>
        </div>
        <div class="infoBox">
            <div v-html="props.title"></div>
            <div class="detailInfoBox">
                <p>
                    <span>{{ props.category_name }}</span>
                    <span>·</span>
                    <span>{{ formatNum(props.like) }}点赞</span>
                    <span>·</span>
                    <span>{{ formatNum(props.reply) }}条评论</span>
                </p>
                <p>{{ props.desc }}</p>
            </div>
            <div>
                <img src="@/assets/videoCardIcon/UP.png"/>
                <span @click="goAuthor">{{ props.uname }}</span>
            </div>
        </div>
    </div> 
</template>

<script lang="ts" setup>
import { formatNum } from '@/utils/format'
interface Props{
    image_urls:string
    title:string        //html
    category_name:string    //专栏类型
    desc:string             //简介
    like:number             //点赞
    reply:number            //评论
    uname:string
}
const props = defineProps<Props>()

function goAuthor(){

}
function go(){

}
</script>

<style lang="scss" scoped>
p{
    padding: 0;
    margin: 0;
}
.Box{
    display: flex;
    justify-content: start;
    align-items: center;
    height: 100%;
    width: 100%;
}
.imgBox{
    display: flex;
    flex-direction: column;
    position: relative;
    width: 23%;
    height: 100%;
    margin-right: 15px;
    & img:nth-child(1){
        object-fit: cover;
        width: 100%;
        height: 100%;
        border-radius: 4px;
        cursor: pointer;
    }
}
.infoBox{
    width: 72%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: start;
    gap: 5px;
    & div:nth-child(1){
        text-align: left;
        width: 100%;
        font-size: 18px;
        color: #18191C;
        font-weight: 600;
        @include noWrap;
        cursor: pointer;
    }
    & div:nth-child(3){
        display: flex;
        justify-content: start;
        align-items: center;
        gap: 3px;
        color: #9499A0;
    }
    & div:nth-child(3) img{
        width: 18px;
        height: 18px;
    }
    & div:nth-child(3) span{
        font-size: 13px;

        white-space: nowrap;
        cursor: pointer;
    }
    & div:nth-child(1):hover,div:nth-child(3):hover{
        color:#409EFF;
    }
}
.detailInfoBox{
    display: flex;
    flex-direction: column;
    justify-content: start;
    font-size: 14px;
    gap: 3px;
    & p:nth-child(1){
        display: flex;
        justify-content: start;
        align-items: center;
        gap: 5px;
        color: #61666D;
    }
    & p:nth-child(2){
        line-height: 18px;
        font-size: 13px;
        text-align: left;
        color: #9499A0;
        @include tweLineShow;
    }
}
</style>